-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show alert before closing transaction flow #2187
Conversation
Branch preview✅ Deploy successful! https://flow_exit_warning--walletweb.review-wallet-web.5afe.dev |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
// Hooks & variables | ||
const [showCloseTooltip, setShowCloseTooltip] = useState<boolean>(false) | ||
const { onClose } = useContext(TxModalContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this used? It was supposed to be an internal callback that outside components should only assign, but not call. Only TxModalProvider should call it. It shouldn't even be exported (my mistake that it is).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the user submits the last sync signature or it is received via poll, it closes the modal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this scenario you’re supposed to call setTxFlow(undefined).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've updated it accordingly, as well as removing onClose
from the context.
What it solves
Resolves direct exit of new transaction flow
How this PR fixes it
A confirmation dialog is now shown when exiting or navigating away from the new transaction flow which needs to first be accepted.
How to test it
Create a transaction, attempt to close the flow/navigate away with back button and observe the new confirmation dialog.
Screenshots
Checklist